﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebApplication1.WebForm4" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function OpenEditWin(frmWin, width, height) {
            var me;
            // 把父页面窗口对象当作参数传递到对话框中，以便对话框操纵父页自动刷新。 
            me = window;
            // 显示对话框。 
            window.showModalDialog(frmWin, me, 'dialogWidth=' + width + 'px;dialogHeight=' + height + 'px;help:no;status:no')
        }

        var se;
        function myrepeaterse(id) {
            se = id.style.backgroundColor;
            id.style.backgroundColor = '#aa11ff';
        }
        function myrepeaterses(id) {
            id.style.backgroundColor = se;
        }    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Repeater ID="rpPerson" runat="server" OnItemCreated="rpPerson_ItemCreated" OnItemCommand="rpPerson_ItemCommand"
            OnItemDataBound="rpPerson_ItemDataBound">
            <HeaderTemplate>
                <table border="0" cellpadding="0" cellspacing="0" style="width: 300px;">
                    <tr style="background-color: Orange">
                        <th align="center">
                            姓名
                        </th>
                        <th align="center">
                            学号
                        </th>
                        <th align="center">
                            年龄
                        </th>
                        <th align="center">
                            学号2
                        </th>
                    </tr>
            </HeaderTemplate>
            <SeparatorTemplate>
                <tr>
                    <td colspan="10" align="center">
                        <hr />
                    </td>
                </tr>
            </SeparatorTemplate>
            <ItemTemplate>
                <tr style="cursor: hand; background-color: ActiveBorder" onmouseover="myrepeaterse(this)"
                    onmouseout="myrepeaterses(this)" ondblclick="openChild(this,<%#Eval("UserNum")%>,5)">
                    <td align="center">
                        <%#Eval("UserName") %>
                    </td>
                    <td align="center">
                        <%#Eval("UserNum") %>
                    </td>
                    <td align="center">
                        <%#Eval("UserAge") %>
                    </td>
                    <td align="center">
                        <asp:Label ID="Label1" runat="server" Text='<%#Eval("UserNum") %>'>'></asp:Label>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
        <br />
        <br />
        <br />
        <div>
            <script type="text/javascript" for="window" event="onload">
             if (window.dialogArguments != null) {
                    //接受主页面传过来的值
                 document.getElementById("backname").value = window.dialogArguments;
                }
            </script>
            <script type="text/javascript">
                function CloseWin() {
                    //在模态页面中设置window对象的returnValue属性，就可以让主页面得到返回值
                    parent.window.returnValue = document.getElementById("backname").value + "输入要传的值"; //父窗口就是上一个页面
                    window.opener = null;
                    window.open("", "_self");
                    window.close();
                }
            </script>
            <input type="text" value="输入要传的值" name="backname" id="backname" />
            &nbsp; &nbsp;<input type="button" name="btnHome" value="传值" id="btnHome" onclick=" return  CloseWin()" />
        </div>
    </div>
    <div>
        <%-- <asp:Repeater ID="Repeater1" runat="server">
            <HeaderTemplate>
                <table border="0" cellpadding="0" cellspacing="0">
                    <tr bgcolor="#add8e6">
                        <td height="25" class="tabletitle" align="center">
                            ID
                        </td>
                        <td class="tabletitle" align="center">
                            状态
                        </td>
                        <td class="tabletitle" align="center">
                            消缺序号
                        </td>
                        <td class="tabletitle" align="center">
                            发现时间
                        </td>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr bgcolor="#e6e6fa" style="cursor: hand" onmouseover="javascript:this.style.backgroundColor='#FFCC33';"
                    onmouseout="javascript:this.style.backgroundColor='#e6e6fa';" ondblclick="openChild(this,<%#Eval("UserNum")%>,5)">
                    <td height="25" align="center">
                        <%#Eval("UserNum")%>
                    </td>
                    <td>
                        <%#Eval("UserAge")%>
                    </td>
                    <td>
                        <%#Eval("UserName")%>
                    </td>
                    <td>
                        <%#Eval("UserNum")%>
                    </td>
                </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <tr bgcolor="#f5f5dc" style="cursor: hand" onmouseover="javascript:this.style.backgroundColor='#FFCC33';"
                    onmouseout="javascript:this.style.backgroundColor='#f5f5dc';" ondblclick="openChild(this,<%#Eval("UserNum")%>,5)">
                    <td height="25" align="center">
                        <%#Eval("UserNum")%>
                    </td>
                    <td>
                        <%#Eval("UserAge")%>
                    </td>
                    <td>
                        <%#Eval("UserName")%>
                    </td>
                    <td>
                        <%#Eval("UserNum")%>
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>--%>
    </div>
    </form>
</body>
</html>
